<nz-drawer [nzClosable]="false" [nzVisible]="visible" nzPlacement="right" nzWidth="500px" nzTitle="检验模板维护"
           [nzFooter]="footerTpl"
           (nzOnClose)="close()">

  <nz-spin [nzSpinning]="nzLoading">

    <form nz-form nzLayout="vertical" [formGroup]="validateForm" (ngSubmit)="submitForm()">

      <nz-form-item>
        <nz-form-label nzFor="code"> 检验模板编号</nz-form-label>
        <nz-form-control nzErrorTip="Please input your code!">
          <input nzSize="small" [readOnly]="isUpdate" nz-input id="code" formControlName="code"/>
        </nz-form-control>
      </nz-form-item>

      <nz-form-item>
        <nz-form-label nzFor="name"> 检验模板名称</nz-form-label>
        <nz-form-control nzErrorTip="Please input your name!">
          <input nzSize="small" nz-input id="name" formControlName="name"/>
        </nz-form-control>
      </nz-form-item>

      <nz-form-item>
        <nz-form-label nzFor="status"> 是否启用</nz-form-label>
        <nz-form-control>
          <nz-select nzSize="small" nzPlaceHolder="Select a enable" formControlName="enable" id="enable">
            <nz-option nzLabel="启用" [nzValue]=1></nz-option>
            <nz-option nzLabel="禁用" [nzValue]=0></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>

      <nz-form-item>
        <nz-form-label nzFor="description"> 检验模板描述</nz-form-label>
        <nz-form-control
          [nzValidateStatus]="validateForm.controls['description']"
          nzErrorTip="Please input description!"
        >
          <textarea nzSize="small" formControlName="description" id="description" nz-input rows="3"
                    placeholder="write any thing"></textarea>
        </nz-form-control>
      </nz-form-item>

    </form>
  </nz-spin>


  <ng-template #footerTpl>
    <div style="float: right">
      <button nz-button style="margin-right: 8px;" (click)="close()">取消</button>
      <button nz-button nzType="primary" (click)="submitForm()">保存</button>
    </div>
  </ng-template>
</nz-drawer>
